<?php
namespace app\api\controller;
use app\common\BaseController;
use think\Db;
use app\api\model\Supplier as SupplierModel;
use app\api\model\Client as ClientModel;
use app\api\model\Guest as GuestModel;
use app\api\model\Category as CategoryModel;
use app\api\model\Manager as ManagerModel;
use app\common\Logs;
class Archives extends BaseController{
    public function __construct(){
        parent::__construct();       
    }
    public function team(){
        $params = $this->request->param();       
        $branchs  = CategoryModel::where('parent_id',9)->select(); 
        $team_own  = CategoryModel::where('parent_id',1)->select();
        $team_kind = CategoryModel::where('parent_id',$params['kind'])->select();      
        $datas = array(           
            'branchs' => $branchs,           
           'team_own' => $team_own,          
           'team_kind' => $team_kind          
        );
        return $datas;
    }   
    
    public function single(){
        $params = $this->request->param();      
        $branchs  = CategoryModel::where('parent_id',9)->select(); 
        $single_own  = CategoryModel::where('parent_id',$params['kind'])->select();
        $single_kind = CategoryModel::where('parent_id',3)->select();       
        $datas = array(           
            'branchs' => $branchs,         
           'single_own' => $single_own,          
           'single_kind' => $single_kind          
        );
        return $datas;
    }   

    public function getList(){
        $params = $this->request->param(); 
        $datas  = CategoryModel::where('parent_id',$params['parent_id'])->select();      
        return $datas;
    }  
}
